<?php

if(!defined("INDEX"))
    die;
    
if(!check_post('message', 'artist_id'))
    throw new HackException();

// ----------------------------------------------------------------------------

$artist = Artist::getById($_POST['artist_id']);

try {

    $artist->addComment($_POST['message'], $user->id);

    $smarty->assign('artist_name', $artist->name);

} catch (Exception $e) {

    $smarty->assign('errors', array($e->getMessage()));
}